#include "EpilFieldParser.h"
#include "EpilParserException.h"


EpilFieldParser::EpilFieldParser( EpilTokenStream & tokens )
: EpilSyntaxParserBase( tokens )
{
}


void EpilFieldParser::Parse()
{
	// field -> ['.' | ':'] NAME
	this->GetTokens().MoveToNext();

	if( this->GetTokens().GetCurrentToken().type != ETT_Identifier )
	{
		throw EpilParserException( t("Identifier expected."), this->GetTokens().GetCurrentToken().location );
	}

	m_fieldName = this->GetTokens().GetCurrentToken().text;
	this->GetTokens().MoveToNext();
}